package com.pactera.bledemo.activity.traditional

import android.os.Bundle
import com.dylanc.viewbinding.nonreflection.binding
import com.pactera.bledemo.base.BaseActivity
import com.pactera.library.bluetooth.Ble
import com.pactera.bledemo.databinding.ActivityClientDetailBinding

class ClientDetailActivity : BaseActivity() {
    private val binding by binding(ActivityClientDetailBinding::inflate)
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        binding.apply {
            btnWrite.setOnClickListener {
                //val text = content.toByteArray(charset("utf-8"))
                val text = "我是移动端发送过去的数据".toByteArray(charset("utf-8"))
                //A50F00100000
                // ble.writeData(text)
                ble.writeData("A50F00100000");
            }
        }
    }

    override fun onDestroy() {
        super.onDestroy()
        //ble.closeConnect()
    }
}